package com.xhs.main.service.cwb.impl;

import com.xhs.main.dao.cwb.CwbProposeredDao;
import com.xhs.main.entity.cwb.CwbProposer;
import com.xhs.main.entity.cwb.CwbProposered;
import com.xhs.main.service.cwb.CwbProposeredService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CwbProposeredServiceImpl implements CwbProposeredService {

    @Autowired
    CwbProposeredDao cwbProposeredDao;


    @Override
    public void addCwbProposered(CwbProposered cwbProposered) {
        cwbProposeredDao.insertCwbProposered(cwbProposered);
    }

    @Override
    public List<CwbProposered> getAllCwbProposered() {
        List<CwbProposered> cwbProposereds = cwbProposeredDao.selectAllCwbProposered();
        return cwbProposereds;
    }

    @Override
    public CwbProposered getOneByID(Integer cwbPId) {
        CwbProposered cwbProposered = cwbProposeredDao.selectOneByID(cwbPId);
        return cwbProposered;
    }

    @Override
    public List<CwbProposered> getAllCwbProposeredByLimit(Integer page, Integer limit) {
        List<CwbProposered> cwbProposereds = cwbProposeredDao.selectAllCwbProposeredByLimit(page, limit);
        return cwbProposereds;
    }

    @Override
    public List<CwbProposered> getByCondition(String employeeID, String applyType, String people, String department, Integer page, Integer limit) {
        List<CwbProposered> cwbProposereds = cwbProposeredDao.selectByCondition(employeeID, applyType, people, department,page,limit);
        return cwbProposereds;
    }

    @Override
    public List<CwbProposered> getAllNoCwbProposered() {
        List<CwbProposered> cwbProposereds = cwbProposeredDao.selectAllNoCwbProposered();
        return cwbProposereds;
    }

    @Override
    public List<CwbProposered> getAllNoCwbProposeredByLimit(Integer page, Integer limit) {
        List<CwbProposered> cwbProposereds = cwbProposeredDao.selectAllNoCwbProposeredByLimit(page, limit);
        return cwbProposereds;
    }

    @Override
    public List<CwbProposered> getByNoCondition(String employeeID, String applyType, String people, String department,Integer page,Integer limit) {
        List<CwbProposered> cwbProposereds = cwbProposeredDao.selectByNoCondition(employeeID, applyType, people, department, page, limit);
        return cwbProposereds;
    }


    @Override
    public Double getAllMoney() {
        Double money = cwbProposeredDao.selectAllMoney();
        return money;
    }

    @Override
    public Integer getAllOpr() {
        Integer count = cwbProposeredDao.selectAllOpr();
        return count;
    }

    @Override
    public Integer getAllNoOpr() {
        Integer count = cwbProposeredDao.selectAllNoOpr();
        return count;
    }
}
